{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "5983b1a5",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Timeline, Bar, Pie\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "8344c5d8",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "add_yaxis() got an unexpected keyword argument 'yaxis_data'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_19256/2478762313.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m   2128\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2129\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0my\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m2002\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2012\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2130\u001b[1;33m     \u001b[0mtimeline\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mget_year_overlap_chart\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0myear\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtime_point\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mstr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2131\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2132\u001b[0m \u001b[1;31m# 1.0.0 版本的 add_schema 暂时没有补上 return self 所以只能这么写着\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_19256/2478762313.py\u001b[0m in \u001b[0;36mget_year_overlap_chart\u001b[1;34m(year)\u001b[0m\n\u001b[0;32m   2069\u001b[0m             \u001b[0myaxis_data\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mtotal_data\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"dataGDP\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0myear\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2070\u001b[0m             \u001b[0mis_selected\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2071\u001b[1;33m             \u001b[0mlabel_opts\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mopts\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mLabelOpts\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mis_show\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2072\u001b[0m         )\n\u001b[0;32m   2073\u001b[0m         .add_yaxis(\n",
      "\u001b[1;31mTypeError\u001b[0m: add_yaxis() got an unexpected keyword argument 'yaxis_data'"
     ]
    }
   ],
   "source": [
    "\n",
    "total_data = {}\n",
    "name_list = [\n",
    "    \"北京\",\n",
    "    \"天津\",\n",
    "    \"河北\",\n",
    "    \"山西\",\n",
    "    \"内蒙古\",\n",
    "    \"辽宁\",\n",
    "    \"吉林\",\n",
    "    \"黑龙江\",\n",
    "    \"上海\",\n",
    "    \"江苏\",\n",
    "    \"浙江\",\n",
    "    \"安徽\",\n",
    "    \"福建\",\n",
    "    \"江西\",\n",
    "    \"山东\",\n",
    "    \"河南\",\n",
    "    \"湖北\",\n",
    "    \"湖南\",\n",
    "    \"广东\",\n",
    "    \"广西\",\n",
    "    \"海南\",\n",
    "    \"重庆\",\n",
    "    \"四川\",\n",
    "    \"贵州\",\n",
    "    \"云南\",\n",
    "    \"西藏\",\n",
    "    \"陕西\",\n",
    "    \"甘肃\",\n",
    "    \"青海\",\n",
    "    \"宁夏\",\n",
    "    \"新疆\",\n",
    "]\n",
    "data_gdp = {\n",
    "    2011: [\n",
    "        16251.93,\n",
    "        11307.28,\n",
    "        24515.76,\n",
    "        11237.55,\n",
    "        14359.88,\n",
    "        22226.7,\n",
    "        10568.83,\n",
    "        12582,\n",
    "        19195.69,\n",
    "        49110.27,\n",
    "        32318.85,\n",
    "        15300.65,\n",
    "        17560.18,\n",
    "        11702.82,\n",
    "        45361.85,\n",
    "        26931.03,\n",
    "        19632.26,\n",
    "        19669.56,\n",
    "        53210.28,\n",
    "        11720.87,\n",
    "        2522.66,\n",
    "        10011.37,\n",
    "        21026.68,\n",
    "        5701.84,\n",
    "        8893.12,\n",
    "        605.83,\n",
    "        12512.3,\n",
    "        5020.37,\n",
    "        1670.44,\n",
    "        2102.21,\n",
    "        6610.05,\n",
    "    ],\n",
    "    2010: [\n",
    "        14113.58,\n",
    "        9224.46,\n",
    "        20394.26,\n",
    "        9200.86,\n",
    "        11672,\n",
    "        18457.27,\n",
    "        8667.58,\n",
    "        10368.6,\n",
    "        17165.98,\n",
    "        41425.48,\n",
    "        27722.31,\n",
    "        12359.33,\n",
    "        14737.12,\n",
    "        9451.26,\n",
    "        39169.92,\n",
    "        23092.36,\n",
    "        15967.61,\n",
    "        16037.96,\n",
    "        46013.06,\n",
    "        9569.85,\n",
    "        2064.5,\n",
    "        7925.58,\n",
    "        17185.48,\n",
    "        4602.16,\n",
    "        7224.18,\n",
    "        507.46,\n",
    "        10123.48,\n",
    "        4120.75,\n",
    "        1350.43,\n",
    "        1689.65,\n",
    "        5437.47,\n",
    "    ],\n",
    "    2009: [\n",
    "        12153.03,\n",
    "        7521.85,\n",
    "        17235.48,\n",
    "        7358.31,\n",
    "        9740.25,\n",
    "        15212.49,\n",
    "        7278.75,\n",
    "        8587,\n",
    "        15046.45,\n",
    "        34457.3,\n",
    "        22990.35,\n",
    "        10062.82,\n",
    "        12236.53,\n",
    "        7655.18,\n",
    "        33896.65,\n",
    "        19480.46,\n",
    "        12961.1,\n",
    "        13059.69,\n",
    "        39482.56,\n",
    "        7759.16,\n",
    "        1654.21,\n",
    "        6530.01,\n",
    "        14151.28,\n",
    "        3912.68,\n",
    "        6169.75,\n",
    "        441.36,\n",
    "        8169.8,\n",
    "        3387.56,\n",
    "        1081.27,\n",
    "        1353.31,\n",
    "        4277.05,\n",
    "    ],\n",
    "    2008: [\n",
    "        11115,\n",
    "        6719.01,\n",
    "        16011.97,\n",
    "        7315.4,\n",
    "        8496.2,\n",
    "        13668.58,\n",
    "        6426.1,\n",
    "        8314.37,\n",
    "        14069.87,\n",
    "        30981.98,\n",
    "        21462.69,\n",
    "        8851.66,\n",
    "        10823.01,\n",
    "        6971.05,\n",
    "        30933.28,\n",
    "        18018.53,\n",
    "        11328.92,\n",
    "        11555,\n",
    "        36796.71,\n",
    "        7021,\n",
    "        1503.06,\n",
    "        5793.66,\n",
    "        12601.23,\n",
    "        3561.56,\n",
    "        5692.12,\n",
    "        394.85,\n",
    "        7314.58,\n",
    "        3166.82,\n",
    "        1018.62,\n",
    "        1203.92,\n",
    "        4183.21,\n",
    "    ],\n",
    "    2007: [\n",
    "        9846.81,\n",
    "        5252.76,\n",
    "        13607.32,\n",
    "        6024.45,\n",
    "        6423.18,\n",
    "        11164.3,\n",
    "        5284.69,\n",
    "        7104,\n",
    "        12494.01,\n",
    "        26018.48,\n",
    "        18753.73,\n",
    "        7360.92,\n",
    "        9248.53,\n",
    "        5800.25,\n",
    "        25776.91,\n",
    "        15012.46,\n",
    "        9333.4,\n",
    "        9439.6,\n",
    "        31777.01,\n",
    "        5823.41,\n",
    "        1254.17,\n",
    "        4676.13,\n",
    "        10562.39,\n",
    "        2884.11,\n",
    "        4772.52,\n",
    "        341.43,\n",
    "        5757.29,\n",
    "        2703.98,\n",
    "        797.35,\n",
    "        919.11,\n",
    "        3523.16,\n",
    "    ],\n",
    "    2006: [\n",
    "        8117.78,\n",
    "        4462.74,\n",
    "        11467.6,\n",
    "        4878.61,\n",
    "        4944.25,\n",
    "        9304.52,\n",
    "        4275.12,\n",
    "        6211.8,\n",
    "        10572.24,\n",
    "        21742.05,\n",
    "        15718.47,\n",
    "        6112.5,\n",
    "        7583.85,\n",
    "        4820.53,\n",
    "        21900.19,\n",
    "        12362.79,\n",
    "        7617.47,\n",
    "        7688.67,\n",
    "        26587.76,\n",
    "        4746.16,\n",
    "        1065.67,\n",
    "        3907.23,\n",
    "        8690.24,\n",
    "        2338.98,\n",
    "        3988.14,\n",
    "        290.76,\n",
    "        4743.61,\n",
    "        2277.35,\n",
    "        648.5,\n",
    "        725.9,\n",
    "        3045.26,\n",
    "    ],\n",
    "    2005: [\n",
    "        6969.52,\n",
    "        3905.64,\n",
    "        10012.11,\n",
    "        4230.53,\n",
    "        3905.03,\n",
    "        8047.26,\n",
    "        3620.27,\n",
    "        5513.7,\n",
    "        9247.66,\n",
    "        18598.69,\n",
    "        13417.68,\n",
    "        5350.17,\n",
    "        6554.69,\n",
    "        4056.76,\n",
    "        18366.87,\n",
    "        10587.42,\n",
    "        6590.19,\n",
    "        6596.1,\n",
    "        22557.37,\n",
    "        3984.1,\n",
    "        918.75,\n",
    "        3467.72,\n",
    "        7385.1,\n",
    "        2005.42,\n",
    "        3462.73,\n",
    "        248.8,\n",
    "        3933.72,\n",
    "        1933.98,\n",
    "        543.32,\n",
    "        612.61,\n",
    "        2604.19,\n",
    "    ],\n",
    "    2004: [\n",
    "        6033.21,\n",
    "        3110.97,\n",
    "        8477.63,\n",
    "        3571.37,\n",
    "        3041.07,\n",
    "        6672,\n",
    "        3122.01,\n",
    "        4750.6,\n",
    "        8072.83,\n",
    "        15003.6,\n",
    "        11648.7,\n",
    "        4759.3,\n",
    "        5763.35,\n",
    "        3456.7,\n",
    "        15021.84,\n",
    "        8553.79,\n",
    "        5633.24,\n",
    "        5641.94,\n",
    "        18864.62,\n",
    "        3433.5,\n",
    "        819.66,\n",
    "        3034.58,\n",
    "        6379.63,\n",
    "        1677.8,\n",
    "        3081.91,\n",
    "        220.34,\n",
    "        3175.58,\n",
    "        1688.49,\n",
    "        466.1,\n",
    "        537.11,\n",
    "        2209.09,\n",
    "    ],\n",
    "    2003: [\n",
    "        5007.21,\n",
    "        2578.03,\n",
    "        6921.29,\n",
    "        2855.23,\n",
    "        2388.38,\n",
    "        6002.54,\n",
    "        2662.08,\n",
    "        4057.4,\n",
    "        6694.23,\n",
    "        12442.87,\n",
    "        9705.02,\n",
    "        3923.11,\n",
    "        4983.67,\n",
    "        2807.41,\n",
    "        12078.15,\n",
    "        6867.7,\n",
    "        4757.45,\n",
    "        4659.99,\n",
    "        15844.64,\n",
    "        2821.11,\n",
    "        713.96,\n",
    "        2555.72,\n",
    "        5333.09,\n",
    "        1426.34,\n",
    "        2556.02,\n",
    "        185.09,\n",
    "        2587.72,\n",
    "        1399.83,\n",
    "        390.2,\n",
    "        445.36,\n",
    "        1886.35,\n",
    "    ],\n",
    "    2002: [\n",
    "        4315,\n",
    "        2150.76,\n",
    "        6018.28,\n",
    "        2324.8,\n",
    "        1940.94,\n",
    "        5458.22,\n",
    "        2348.54,\n",
    "        3637.2,\n",
    "        5741.03,\n",
    "        10606.85,\n",
    "        8003.67,\n",
    "        3519.72,\n",
    "        4467.55,\n",
    "        2450.48,\n",
    "        10275.5,\n",
    "        6035.48,\n",
    "        4212.82,\n",
    "        4151.54,\n",
    "        13502.42,\n",
    "        2523.73,\n",
    "        642.73,\n",
    "        2232.86,\n",
    "        4725.01,\n",
    "        1243.43,\n",
    "        2312.82,\n",
    "        162.04,\n",
    "        2253.39,\n",
    "        1232.03,\n",
    "        340.65,\n",
    "        377.16,\n",
    "        1612.6,\n",
    "    ],\n",
    "}\n",
    "\n",
    "data_pi = {\n",
    "    2011: [\n",
    "        136.27,\n",
    "        159.72,\n",
    "        2905.73,\n",
    "        641.42,\n",
    "        1306.3,\n",
    "        1915.57,\n",
    "        1277.44,\n",
    "        1701.5,\n",
    "        124.94,\n",
    "        3064.78,\n",
    "        1583.04,\n",
    "        2015.31,\n",
    "        1612.24,\n",
    "        1391.07,\n",
    "        3973.85,\n",
    "        3512.24,\n",
    "        2569.3,\n",
    "        2768.03,\n",
    "        2665.2,\n",
    "        2047.23,\n",
    "        659.23,\n",
    "        844.52,\n",
    "        2983.51,\n",
    "        726.22,\n",
    "        1411.01,\n",
    "        74.47,\n",
    "        1220.9,\n",
    "        678.75,\n",
    "        155.08,\n",
    "        184.14,\n",
    "        1139.03,\n",
    "    ],\n",
    "    2010: [\n",
    "        124.36,\n",
    "        145.58,\n",
    "        2562.81,\n",
    "        554.48,\n",
    "        1095.28,\n",
    "        1631.08,\n",
    "        1050.15,\n",
    "        1302.9,\n",
    "        114.15,\n",
    "        2540.1,\n",
    "        1360.56,\n",
    "        1729.02,\n",
    "        1363.67,\n",
    "        1206.98,\n",
    "        3588.28,\n",
    "        3258.09,\n",
    "        2147,\n",
    "        2325.5,\n",
    "        2286.98,\n",
    "        1675.06,\n",
    "        539.83,\n",
    "        685.38,\n",
    "        2482.89,\n",
    "        625.03,\n",
    "        1108.38,\n",
    "        68.72,\n",
    "        988.45,\n",
    "        599.28,\n",
    "        134.92,\n",
    "        159.29,\n",
    "        1078.63,\n",
    "    ],\n",
    "    2009: [\n",
    "        118.29,\n",
    "        128.85,\n",
    "        2207.34,\n",
    "        477.59,\n",
    "        929.6,\n",
    "        1414.9,\n",
    "        980.57,\n",
    "        1154.33,\n",
    "        113.82,\n",
    "        2261.86,\n",
    "        1163.08,\n",
    "        1495.45,\n",
    "        1182.74,\n",
    "        1098.66,\n",
    "        3226.64,\n",
    "        2769.05,\n",
    "        1795.9,\n",
    "        1969.69,\n",
    "        2010.27,\n",
    "        1458.49,\n",
    "        462.19,\n",
    "        606.8,\n",
    "        2240.61,\n",
    "        550.27,\n",
    "        1067.6,\n",
    "        63.88,\n",
    "        789.64,\n",
    "        497.05,\n",
    "        107.4,\n",
    "        127.25,\n",
    "        759.74,\n",
    "    ],\n",
    "    2008: [\n",
    "        112.83,\n",
    "        122.58,\n",
    "        2034.59,\n",
    "        313.58,\n",
    "        907.95,\n",
    "        1302.02,\n",
    "        916.72,\n",
    "        1088.94,\n",
    "        111.8,\n",
    "        2100.11,\n",
    "        1095.96,\n",
    "        1418.09,\n",
    "        1158.17,\n",
    "        1060.38,\n",
    "        3002.65,\n",
    "        2658.78,\n",
    "        1780,\n",
    "        1892.4,\n",
    "        1973.05,\n",
    "        1453.75,\n",
    "        436.04,\n",
    "        575.4,\n",
    "        2216.15,\n",
    "        539.19,\n",
    "        1020.56,\n",
    "        60.62,\n",
    "        753.72,\n",
    "        462.27,\n",
    "        105.57,\n",
    "        118.94,\n",
    "        691.07,\n",
    "    ],\n",
    "    2007: [\n",
    "        101.26,\n",
    "        110.19,\n",
    "        1804.72,\n",
    "        311.97,\n",
    "        762.1,\n",
    "        1133.42,\n",
    "        783.8,\n",
    "        915.38,\n",
    "        101.84,\n",
    "        1816.31,\n",
    "        986.02,\n",
    "        1200.18,\n",
    "        1002.11,\n",
    "        905.77,\n",
    "        2509.14,\n",
    "        2217.66,\n",
    "        1378,\n",
    "        1626.48,\n",
    "        1695.57,\n",
    "        1241.35,\n",
    "        361.07,\n",
    "        482.39,\n",
    "        2032,\n",
    "        446.38,\n",
    "        837.35,\n",
    "        54.89,\n",
    "        592.63,\n",
    "        387.55,\n",
    "        83.41,\n",
    "        97.89,\n",
    "        628.72,\n",
    "    ],\n",
    "    2006: [\n",
    "        88.8,\n",
    "        103.35,\n",
    "        1461.81,\n",
    "        276.77,\n",
    "        634.94,\n",
    "        939.43,\n",
    "        672.76,\n",
    "        750.14,\n",
    "        93.81,\n",
    "        1545.05,\n",
    "        925.1,\n",
    "        1011.03,\n",
    "        865.98,\n",
    "        786.14,\n",
    "        2138.9,\n",
    "        1916.74,\n",
    "        1140.41,\n",
    "        1272.2,\n",
    "        1532.17,\n",
    "        1032.47,\n",
    "        323.48,\n",
    "        386.38,\n",
    "        1595.48,\n",
    "        382.06,\n",
    "        724.4,\n",
    "        50.9,\n",
    "        484.81,\n",
    "        334,\n",
    "        67.55,\n",
    "        79.54,\n",
    "        527.8,\n",
    "    ],\n",
    "    2005: [\n",
    "        88.68,\n",
    "        112.38,\n",
    "        1400,\n",
    "        262.42,\n",
    "        589.56,\n",
    "        882.41,\n",
    "        625.61,\n",
    "        684.6,\n",
    "        90.26,\n",
    "        1461.51,\n",
    "        892.83,\n",
    "        966.5,\n",
    "        827.36,\n",
    "        727.37,\n",
    "        1963.51,\n",
    "        1892.01,\n",
    "        1082.13,\n",
    "        1100.65,\n",
    "        1428.27,\n",
    "        912.5,\n",
    "        300.75,\n",
    "        463.4,\n",
    "        1481.14,\n",
    "        368.94,\n",
    "        661.69,\n",
    "        48.04,\n",
    "        435.77,\n",
    "        308.06,\n",
    "        65.34,\n",
    "        72.07,\n",
    "        509.99,\n",
    "    ],\n",
    "    2004: [\n",
    "        87.36,\n",
    "        105.28,\n",
    "        1370.43,\n",
    "        276.3,\n",
    "        522.8,\n",
    "        798.43,\n",
    "        568.69,\n",
    "        605.79,\n",
    "        83.45,\n",
    "        1367.58,\n",
    "        814.1,\n",
    "        950.5,\n",
    "        786.84,\n",
    "        664.5,\n",
    "        1778.45,\n",
    "        1649.29,\n",
    "        1020.09,\n",
    "        1022.45,\n",
    "        1248.59,\n",
    "        817.88,\n",
    "        278.76,\n",
    "        428.05,\n",
    "        1379.93,\n",
    "        334.5,\n",
    "        607.75,\n",
    "        44.3,\n",
    "        387.88,\n",
    "        286.78,\n",
    "        60.7,\n",
    "        65.33,\n",
    "        461.26,\n",
    "    ],\n",
    "    2003: [\n",
    "        84.11,\n",
    "        89.91,\n",
    "        1064.05,\n",
    "        215.19,\n",
    "        420.1,\n",
    "        615.8,\n",
    "        488.23,\n",
    "        504.8,\n",
    "        81.02,\n",
    "        1162.45,\n",
    "        717.85,\n",
    "        749.4,\n",
    "        692.94,\n",
    "        560,\n",
    "        1480.67,\n",
    "        1198.7,\n",
    "        798.35,\n",
    "        886.47,\n",
    "        1072.91,\n",
    "        658.78,\n",
    "        244.29,\n",
    "        339.06,\n",
    "        1128.61,\n",
    "        298.69,\n",
    "        494.6,\n",
    "        40.7,\n",
    "        302.66,\n",
    "        237.91,\n",
    "        48.47,\n",
    "        55.63,\n",
    "        412.9,\n",
    "    ],\n",
    "    2002: [\n",
    "        82.44,\n",
    "        84.21,\n",
    "        956.84,\n",
    "        197.8,\n",
    "        374.69,\n",
    "        590.2,\n",
    "        446.17,\n",
    "        474.2,\n",
    "        79.68,\n",
    "        1110.44,\n",
    "        685.2,\n",
    "        783.66,\n",
    "        664.78,\n",
    "        535.98,\n",
    "        1390,\n",
    "        1288.36,\n",
    "        707,\n",
    "        847.25,\n",
    "        1015.08,\n",
    "        601.99,\n",
    "        222.89,\n",
    "        317.87,\n",
    "        1047.95,\n",
    "        281.1,\n",
    "        463.44,\n",
    "        39.75,\n",
    "        282.21,\n",
    "        215.51,\n",
    "        47.31,\n",
    "        52.95,\n",
    "        305,\n",
    "    ],\n",
    "}\n",
    "\n",
    "data_si = {\n",
    "    2011: [\n",
    "        3752.48,\n",
    "        5928.32,\n",
    "        13126.86,\n",
    "        6635.26,\n",
    "        8037.69,\n",
    "        12152.15,\n",
    "        5611.48,\n",
    "        5962.41,\n",
    "        7927.89,\n",
    "        25203.28,\n",
    "        16555.58,\n",
    "        8309.38,\n",
    "        9069.2,\n",
    "        6390.55,\n",
    "        24017.11,\n",
    "        15427.08,\n",
    "        9815.94,\n",
    "        9361.99,\n",
    "        26447.38,\n",
    "        5675.32,\n",
    "        714.5,\n",
    "        5543.04,\n",
    "        11029.13,\n",
    "        2194.33,\n",
    "        3780.32,\n",
    "        208.79,\n",
    "        6935.59,\n",
    "        2377.83,\n",
    "        975.18,\n",
    "        1056.15,\n",
    "        3225.9,\n",
    "    ],\n",
    "    2010: [\n",
    "        3388.38,\n",
    "        4840.23,\n",
    "        10707.68,\n",
    "        5234,\n",
    "        6367.69,\n",
    "        9976.82,\n",
    "        4506.31,\n",
    "        5025.15,\n",
    "        7218.32,\n",
    "        21753.93,\n",
    "        14297.93,\n",
    "        6436.62,\n",
    "        7522.83,\n",
    "        5122.88,\n",
    "        21238.49,\n",
    "        13226.38,\n",
    "        7767.24,\n",
    "        7343.19,\n",
    "        23014.53,\n",
    "        4511.68,\n",
    "        571,\n",
    "        4359.12,\n",
    "        8672.18,\n",
    "        1800.06,\n",
    "        3223.49,\n",
    "        163.92,\n",
    "        5446.1,\n",
    "        1984.97,\n",
    "        744.63,\n",
    "        827.91,\n",
    "        2592.15,\n",
    "    ],\n",
    "    2009: [\n",
    "        2855.55,\n",
    "        3987.84,\n",
    "        8959.83,\n",
    "        3993.8,\n",
    "        5114,\n",
    "        7906.34,\n",
    "        3541.92,\n",
    "        4060.72,\n",
    "        6001.78,\n",
    "        18566.37,\n",
    "        11908.49,\n",
    "        4905.22,\n",
    "        6005.3,\n",
    "        3919.45,\n",
    "        18901.83,\n",
    "        11010.5,\n",
    "        6038.08,\n",
    "        5687.19,\n",
    "        19419.7,\n",
    "        3381.54,\n",
    "        443.43,\n",
    "        3448.77,\n",
    "        6711.87,\n",
    "        1476.62,\n",
    "        2582.53,\n",
    "        136.63,\n",
    "        4236.42,\n",
    "        1527.24,\n",
    "        575.33,\n",
    "        662.32,\n",
    "        1929.59,\n",
    "    ],\n",
    "    2008: [\n",
    "        2626.41,\n",
    "        3709.78,\n",
    "        8701.34,\n",
    "        4242.36,\n",
    "        4376.19,\n",
    "        7158.84,\n",
    "        3097.12,\n",
    "        4319.75,\n",
    "        6085.84,\n",
    "        16993.34,\n",
    "        11567.42,\n",
    "        4198.93,\n",
    "        5318.44,\n",
    "        3554.81,\n",
    "        17571.98,\n",
    "        10259.99,\n",
    "        5082.07,\n",
    "        5028.93,\n",
    "        18502.2,\n",
    "        3037.74,\n",
    "        423.55,\n",
    "        3057.78,\n",
    "        5823.39,\n",
    "        1370.03,\n",
    "        2452.75,\n",
    "        115.56,\n",
    "        3861.12,\n",
    "        1470.34,\n",
    "        557.12,\n",
    "        609.98,\n",
    "        2070.76,\n",
    "    ],\n",
    "    2007: [\n",
    "        2509.4,\n",
    "        2892.53,\n",
    "        7201.88,\n",
    "        3454.49,\n",
    "        3193.67,\n",
    "        5544.14,\n",
    "        2475.45,\n",
    "        3695.58,\n",
    "        5571.06,\n",
    "        14471.26,\n",
    "        10154.25,\n",
    "        3370.96,\n",
    "        4476.42,\n",
    "        2975.53,\n",
    "        14647.53,\n",
    "        8282.83,\n",
    "        4143.06,\n",
    "        3977.72,\n",
    "        16004.61,\n",
    "        2425.29,\n",
    "        364.26,\n",
    "        2368.53,\n",
    "        4648.79,\n",
    "        1124.79,\n",
    "        2038.39,\n",
    "        98.48,\n",
    "        2986.46,\n",
    "        1279.32,\n",
    "        419.03,\n",
    "        455.04,\n",
    "        1647.55,\n",
    "    ],\n",
    "    2006: [\n",
    "        2191.43,\n",
    "        2457.08,\n",
    "        6110.43,\n",
    "        2755.66,\n",
    "        2374.96,\n",
    "        4566.83,\n",
    "        1915.29,\n",
    "        3365.31,\n",
    "        4969.95,\n",
    "        12282.89,\n",
    "        8511.51,\n",
    "        2711.18,\n",
    "        3695.04,\n",
    "        2419.74,\n",
    "        12574.03,\n",
    "        6724.61,\n",
    "        3365.08,\n",
    "        3187.05,\n",
    "        13469.77,\n",
    "        1878.56,\n",
    "        308.62,\n",
    "        1871.65,\n",
    "        3775.14,\n",
    "        967.54,\n",
    "        1705.83,\n",
    "        80.1,\n",
    "        2452.44,\n",
    "        1043.19,\n",
    "        331.91,\n",
    "        351.58,\n",
    "        1459.3,\n",
    "    ],\n",
    "    2005: [\n",
    "        2026.51,\n",
    "        2135.07,\n",
    "        5271.57,\n",
    "        2357.04,\n",
    "        1773.21,\n",
    "        3869.4,\n",
    "        1580.83,\n",
    "        2971.68,\n",
    "        4381.2,\n",
    "        10524.96,\n",
    "        7164.75,\n",
    "        2245.9,\n",
    "        3175.92,\n",
    "        1917.47,\n",
    "        10478.62,\n",
    "        5514.14,\n",
    "        2852.12,\n",
    "        2612.57,\n",
    "        11356.6,\n",
    "        1510.68,\n",
    "        240.83,\n",
    "        1564,\n",
    "        3067.23,\n",
    "        821.16,\n",
    "        1426.42,\n",
    "        63.52,\n",
    "        1951.36,\n",
    "        838.56,\n",
    "        264.61,\n",
    "        281.05,\n",
    "        1164.79,\n",
    "    ],\n",
    "    2004: [\n",
    "        1853.58,\n",
    "        1685.93,\n",
    "        4301.73,\n",
    "        1919.4,\n",
    "        1248.27,\n",
    "        3061.62,\n",
    "        1329.68,\n",
    "        2487.04,\n",
    "        3892.12,\n",
    "        8437.99,\n",
    "        6250.38,\n",
    "        1844.9,\n",
    "        2770.49,\n",
    "        1566.4,\n",
    "        8478.69,\n",
    "        4182.1,\n",
    "        2320.6,\n",
    "        2190.54,\n",
    "        9280.73,\n",
    "        1253.7,\n",
    "        205.6,\n",
    "        1376.91,\n",
    "        2489.4,\n",
    "        681.5,\n",
    "        1281.63,\n",
    "        52.74,\n",
    "        1553.1,\n",
    "        713.3,\n",
    "        211.7,\n",
    "        244.05,\n",
    "        914.47,\n",
    "    ],\n",
    "    2003: [\n",
    "        1487.15,\n",
    "        1337.31,\n",
    "        3417.56,\n",
    "        1463.38,\n",
    "        967.49,\n",
    "        2898.89,\n",
    "        1098.37,\n",
    "        2084.7,\n",
    "        3209.02,\n",
    "        6787.11,\n",
    "        5096.38,\n",
    "        1535.29,\n",
    "        2340.82,\n",
    "        1204.33,\n",
    "        6485.05,\n",
    "        3310.14,\n",
    "        1956.02,\n",
    "        1777.74,\n",
    "        7592.78,\n",
    "        984.08,\n",
    "        175.82,\n",
    "        1135.31,\n",
    "        2014.8,\n",
    "        569.37,\n",
    "        1047.66,\n",
    "        47.64,\n",
    "        1221.17,\n",
    "        572.02,\n",
    "        171.92,\n",
    "        194.27,\n",
    "        719.54,\n",
    "    ],\n",
    "    2002: [\n",
    "        1249.99,\n",
    "        1069.08,\n",
    "        2911.69,\n",
    "        1134.31,\n",
    "        754.78,\n",
    "        2609.85,\n",
    "        943.49,\n",
    "        1843.6,\n",
    "        2622.45,\n",
    "        5604.49,\n",
    "        4090.48,\n",
    "        1337.04,\n",
    "        2036.97,\n",
    "        941.77,\n",
    "        5184.98,\n",
    "        2768.75,\n",
    "        1709.89,\n",
    "        1523.5,\n",
    "        6143.4,\n",
    "        846.89,\n",
    "        148.88,\n",
    "        958.87,\n",
    "        1733.38,\n",
    "        481.96,\n",
    "        934.88,\n",
    "        32.72,\n",
    "        1007.56,\n",
    "        501.69,\n",
    "        144.51,\n",
    "        153.06,\n",
    "        603.15,\n",
    "    ],\n",
    "}\n",
    "\n",
    "data_ti = {\n",
    "    2011: [\n",
    "        12363.18,\n",
    "        5219.24,\n",
    "        8483.17,\n",
    "        3960.87,\n",
    "        5015.89,\n",
    "        8158.98,\n",
    "        3679.91,\n",
    "        4918.09,\n",
    "        11142.86,\n",
    "        20842.21,\n",
    "        14180.23,\n",
    "        4975.96,\n",
    "        6878.74,\n",
    "        3921.2,\n",
    "        17370.89,\n",
    "        7991.72,\n",
    "        7247.02,\n",
    "        7539.54,\n",
    "        24097.7,\n",
    "        3998.33,\n",
    "        1148.93,\n",
    "        3623.81,\n",
    "        7014.04,\n",
    "        2781.29,\n",
    "        3701.79,\n",
    "        322.57,\n",
    "        4355.81,\n",
    "        1963.79,\n",
    "        540.18,\n",
    "        861.92,\n",
    "        2245.12,\n",
    "    ],\n",
    "    2010: [\n",
    "        10600.84,\n",
    "        4238.65,\n",
    "        7123.77,\n",
    "        3412.38,\n",
    "        4209.03,\n",
    "        6849.37,\n",
    "        3111.12,\n",
    "        4040.55,\n",
    "        9833.51,\n",
    "        17131.45,\n",
    "        12063.82,\n",
    "        4193.69,\n",
    "        5850.62,\n",
    "        3121.4,\n",
    "        14343.14,\n",
    "        6607.89,\n",
    "        6053.37,\n",
    "        6369.27,\n",
    "        20711.55,\n",
    "        3383.11,\n",
    "        953.67,\n",
    "        2881.08,\n",
    "        6030.41,\n",
    "        2177.07,\n",
    "        2892.31,\n",
    "        274.82,\n",
    "        3688.93,\n",
    "        1536.5,\n",
    "        470.88,\n",
    "        702.45,\n",
    "        1766.69,\n",
    "    ],\n",
    "    2009: [\n",
    "        9179.19,\n",
    "        3405.16,\n",
    "        6068.31,\n",
    "        2886.92,\n",
    "        3696.65,\n",
    "        5891.25,\n",
    "        2756.26,\n",
    "        3371.95,\n",
    "        8930.85,\n",
    "        13629.07,\n",
    "        9918.78,\n",
    "        3662.15,\n",
    "        5048.49,\n",
    "        2637.07,\n",
    "        11768.18,\n",
    "        5700.91,\n",
    "        5127.12,\n",
    "        5402.81,\n",
    "        18052.59,\n",
    "        2919.13,\n",
    "        748.59,\n",
    "        2474.44,\n",
    "        5198.8,\n",
    "        1885.79,\n",
    "        2519.62,\n",
    "        240.85,\n",
    "        3143.74,\n",
    "        1363.27,\n",
    "        398.54,\n",
    "        563.74,\n",
    "        1587.72,\n",
    "    ],\n",
    "    2008: [\n",
    "        8375.76,\n",
    "        2886.65,\n",
    "        5276.04,\n",
    "        2759.46,\n",
    "        3212.06,\n",
    "        5207.72,\n",
    "        2412.26,\n",
    "        2905.68,\n",
    "        7872.23,\n",
    "        11888.53,\n",
    "        8799.31,\n",
    "        3234.64,\n",
    "        4346.4,\n",
    "        2355.86,\n",
    "        10358.64,\n",
    "        5099.76,\n",
    "        4466.85,\n",
    "        4633.67,\n",
    "        16321.46,\n",
    "        2529.51,\n",
    "        643.47,\n",
    "        2160.48,\n",
    "        4561.69,\n",
    "        1652.34,\n",
    "        2218.81,\n",
    "        218.67,\n",
    "        2699.74,\n",
    "        1234.21,\n",
    "        355.93,\n",
    "        475,\n",
    "        1421.38,\n",
    "    ],\n",
    "    2007: [\n",
    "        7236.15,\n",
    "        2250.04,\n",
    "        4600.72,\n",
    "        2257.99,\n",
    "        2467.41,\n",
    "        4486.74,\n",
    "        2025.44,\n",
    "        2493.04,\n",
    "        6821.11,\n",
    "        9730.91,\n",
    "        7613.46,\n",
    "        2789.78,\n",
    "        3770,\n",
    "        1918.95,\n",
    "        8620.24,\n",
    "        4511.97,\n",
    "        3812.34,\n",
    "        3835.4,\n",
    "        14076.83,\n",
    "        2156.76,\n",
    "        528.84,\n",
    "        1825.21,\n",
    "        3881.6,\n",
    "        1312.94,\n",
    "        1896.78,\n",
    "        188.06,\n",
    "        2178.2,\n",
    "        1037.11,\n",
    "        294.91,\n",
    "        366.18,\n",
    "        1246.89,\n",
    "    ],\n",
    "    2006: [\n",
    "        5837.55,\n",
    "        1902.31,\n",
    "        3895.36,\n",
    "        1846.18,\n",
    "        1934.35,\n",
    "        3798.26,\n",
    "        1687.07,\n",
    "        2096.35,\n",
    "        5508.48,\n",
    "        7914.11,\n",
    "        6281.86,\n",
    "        2390.29,\n",
    "        3022.83,\n",
    "        1614.65,\n",
    "        7187.26,\n",
    "        3721.44,\n",
    "        3111.98,\n",
    "        3229.42,\n",
    "        11585.82,\n",
    "        1835.12,\n",
    "        433.57,\n",
    "        1649.2,\n",
    "        3319.62,\n",
    "        989.38,\n",
    "        1557.91,\n",
    "        159.76,\n",
    "        1806.36,\n",
    "        900.16,\n",
    "        249.04,\n",
    "        294.78,\n",
    "        1058.16,\n",
    "    ],\n",
    "    2005: [\n",
    "        4854.33,\n",
    "        1658.19,\n",
    "        3340.54,\n",
    "        1611.07,\n",
    "        1542.26,\n",
    "        3295.45,\n",
    "        1413.83,\n",
    "        1857.42,\n",
    "        4776.2,\n",
    "        6612.22,\n",
    "        5360.1,\n",
    "        2137.77,\n",
    "        2551.41,\n",
    "        1411.92,\n",
    "        5924.74,\n",
    "        3181.27,\n",
    "        2655.94,\n",
    "        2882.88,\n",
    "        9772.5,\n",
    "        1560.92,\n",
    "        377.17,\n",
    "        1440.32,\n",
    "        2836.73,\n",
    "        815.32,\n",
    "        1374.62,\n",
    "        137.24,\n",
    "        1546.59,\n",
    "        787.36,\n",
    "        213.37,\n",
    "        259.49,\n",
    "        929.41,\n",
    "    ],\n",
    "    2004: [\n",
    "        4092.27,\n",
    "        1319.76,\n",
    "        2805.47,\n",
    "        1375.67,\n",
    "        1270,\n",
    "        2811.95,\n",
    "        1223.64,\n",
    "        1657.77,\n",
    "        4097.26,\n",
    "        5198.03,\n",
    "        4584.22,\n",
    "        1963.9,\n",
    "        2206.02,\n",
    "        1225.8,\n",
    "        4764.7,\n",
    "        2722.4,\n",
    "        2292.55,\n",
    "        2428.95,\n",
    "        8335.3,\n",
    "        1361.92,\n",
    "        335.3,\n",
    "        1229.62,\n",
    "        2510.3,\n",
    "        661.8,\n",
    "        1192.53,\n",
    "        123.3,\n",
    "        1234.6,\n",
    "        688.41,\n",
    "        193.7,\n",
    "        227.73,\n",
    "        833.36,\n",
    "    ],\n",
    "    2003: [\n",
    "        3435.95,\n",
    "        1150.81,\n",
    "        2439.68,\n",
    "        1176.65,\n",
    "        1000.79,\n",
    "        2487.85,\n",
    "        1075.48,\n",
    "        1467.9,\n",
    "        3404.19,\n",
    "        4493.31,\n",
    "        3890.79,\n",
    "        1638.42,\n",
    "        1949.91,\n",
    "        1043.08,\n",
    "        4112.43,\n",
    "        2358.86,\n",
    "        2003.08,\n",
    "        1995.78,\n",
    "        7178.94,\n",
    "        1178.25,\n",
    "        293.85,\n",
    "        1081.35,\n",
    "        2189.68,\n",
    "        558.28,\n",
    "        1013.76,\n",
    "        96.76,\n",
    "        1063.89,\n",
    "        589.91,\n",
    "        169.81,\n",
    "        195.46,\n",
    "        753.91,\n",
    "    ],\n",
    "    2002: [\n",
    "        2982.57,\n",
    "        997.47,\n",
    "        2149.75,\n",
    "        992.69,\n",
    "        811.47,\n",
    "        2258.17,\n",
    "        958.88,\n",
    "        1319.4,\n",
    "        3038.9,\n",
    "        3891.92,\n",
    "        3227.99,\n",
    "        1399.02,\n",
    "        1765.8,\n",
    "        972.73,\n",
    "        3700.52,\n",
    "        1978.37,\n",
    "        1795.93,\n",
    "        1780.79,\n",
    "        6343.94,\n",
    "        1074.85,\n",
    "        270.96,\n",
    "        956.12,\n",
    "        1943.68,\n",
    "        480.37,\n",
    "        914.5,\n",
    "        89.56,\n",
    "        963.62,\n",
    "        514.83,\n",
    "        148.83,\n",
    "        171.14,\n",
    "        704.5,\n",
    "    ],\n",
    "}\n",
    "\n",
    "data_estate = {\n",
    "    2011: [\n",
    "        12363.18,\n",
    "        5219.24,\n",
    "        8483.17,\n",
    "        3960.87,\n",
    "        5015.89,\n",
    "        8158.98,\n",
    "        3679.91,\n",
    "        4918.09,\n",
    "        11142.86,\n",
    "        20842.21,\n",
    "        14180.23,\n",
    "        4975.96,\n",
    "        6878.74,\n",
    "        3921.2,\n",
    "        17370.89,\n",
    "        7991.72,\n",
    "        7247.02,\n",
    "        7539.54,\n",
    "        24097.7,\n",
    "        3998.33,\n",
    "        1148.93,\n",
    "        3623.81,\n",
    "        7014.04,\n",
    "        2781.29,\n",
    "        3701.79,\n",
    "        322.57,\n",
    "        4355.81,\n",
    "        1963.79,\n",
    "        540.18,\n",
    "        861.92,\n",
    "        2245.12,\n",
    "    ],\n",
    "    2010: [\n",
    "        10600.84,\n",
    "        4238.65,\n",
    "        7123.77,\n",
    "        3412.38,\n",
    "        4209.03,\n",
    "        6849.37,\n",
    "        3111.12,\n",
    "        4040.55,\n",
    "        9833.51,\n",
    "        17131.45,\n",
    "        12063.82,\n",
    "        4193.69,\n",
    "        5850.62,\n",
    "        3121.4,\n",
    "        14343.14,\n",
    "        6607.89,\n",
    "        6053.37,\n",
    "        6369.27,\n",
    "        20711.55,\n",
    "        3383.11,\n",
    "        953.67,\n",
    "        2881.08,\n",
    "        6030.41,\n",
    "        2177.07,\n",
    "        2892.31,\n",
    "        274.82,\n",
    "        3688.93,\n",
    "        1536.5,\n",
    "        470.88,\n",
    "        702.45,\n",
    "        1766.69,\n",
    "    ],\n",
    "    2009: [\n",
    "        9179.19,\n",
    "        3405.16,\n",
    "        6068.31,\n",
    "        2886.92,\n",
    "        3696.65,\n",
    "        5891.25,\n",
    "        2756.26,\n",
    "        3371.95,\n",
    "        8930.85,\n",
    "        13629.07,\n",
    "        9918.78,\n",
    "        3662.15,\n",
    "        5048.49,\n",
    "        2637.07,\n",
    "        11768.18,\n",
    "        5700.91,\n",
    "        5127.12,\n",
    "        5402.81,\n",
    "        18052.59,\n",
    "        2919.13,\n",
    "        748.59,\n",
    "        2474.44,\n",
    "        5198.8,\n",
    "        1885.79,\n",
    "        2519.62,\n",
    "        240.85,\n",
    "        3143.74,\n",
    "        1363.27,\n",
    "        398.54,\n",
    "        563.74,\n",
    "        1587.72,\n",
    "    ],\n",
    "    2008: [\n",
    "        8375.76,\n",
    "        2886.65,\n",
    "        5276.04,\n",
    "        2759.46,\n",
    "        3212.06,\n",
    "        5207.72,\n",
    "        2412.26,\n",
    "        2905.68,\n",
    "        7872.23,\n",
    "        11888.53,\n",
    "        8799.31,\n",
    "        3234.64,\n",
    "        4346.4,\n",
    "        2355.86,\n",
    "        10358.64,\n",
    "        5099.76,\n",
    "        4466.85,\n",
    "        4633.67,\n",
    "        16321.46,\n",
    "        2529.51,\n",
    "        643.47,\n",
    "        2160.48,\n",
    "        4561.69,\n",
    "        1652.34,\n",
    "        2218.81,\n",
    "        218.67,\n",
    "        2699.74,\n",
    "        1234.21,\n",
    "        355.93,\n",
    "        475,\n",
    "        1421.38,\n",
    "    ],\n",
    "    2007: [\n",
    "        7236.15,\n",
    "        2250.04,\n",
    "        4600.72,\n",
    "        2257.99,\n",
    "        2467.41,\n",
    "        4486.74,\n",
    "        2025.44,\n",
    "        2493.04,\n",
    "        6821.11,\n",
    "        9730.91,\n",
    "        7613.46,\n",
    "        2789.78,\n",
    "        3770,\n",
    "        1918.95,\n",
    "        8620.24,\n",
    "        4511.97,\n",
    "        3812.34,\n",
    "        3835.4,\n",
    "        14076.83,\n",
    "        2156.76,\n",
    "        528.84,\n",
    "        1825.21,\n",
    "        3881.6,\n",
    "        1312.94,\n",
    "        1896.78,\n",
    "        188.06,\n",
    "        2178.2,\n",
    "        1037.11,\n",
    "        294.91,\n",
    "        366.18,\n",
    "        1246.89,\n",
    "    ],\n",
    "    2006: [\n",
    "        5837.55,\n",
    "        1902.31,\n",
    "        3895.36,\n",
    "        1846.18,\n",
    "        1934.35,\n",
    "        3798.26,\n",
    "        1687.07,\n",
    "        2096.35,\n",
    "        5508.48,\n",
    "        7914.11,\n",
    "        6281.86,\n",
    "        2390.29,\n",
    "        3022.83,\n",
    "        1614.65,\n",
    "        7187.26,\n",
    "        3721.44,\n",
    "        3111.98,\n",
    "        3229.42,\n",
    "        11585.82,\n",
    "        1835.12,\n",
    "        433.57,\n",
    "        1649.2,\n",
    "        3319.62,\n",
    "        989.38,\n",
    "        1557.91,\n",
    "        159.76,\n",
    "        1806.36,\n",
    "        900.16,\n",
    "        249.04,\n",
    "        294.78,\n",
    "        1058.16,\n",
    "    ],\n",
    "    2005: [\n",
    "        4854.33,\n",
    "        1658.19,\n",
    "        3340.54,\n",
    "        1611.07,\n",
    "        1542.26,\n",
    "        3295.45,\n",
    "        1413.83,\n",
    "        1857.42,\n",
    "        4776.2,\n",
    "        6612.22,\n",
    "        5360.1,\n",
    "        2137.77,\n",
    "        2551.41,\n",
    "        1411.92,\n",
    "        5924.74,\n",
    "        3181.27,\n",
    "        2655.94,\n",
    "        2882.88,\n",
    "        9772.5,\n",
    "        1560.92,\n",
    "        377.17,\n",
    "        1440.32,\n",
    "        2836.73,\n",
    "        815.32,\n",
    "        1374.62,\n",
    "        137.24,\n",
    "        1546.59,\n",
    "        787.36,\n",
    "        213.37,\n",
    "        259.49,\n",
    "        929.41,\n",
    "    ],\n",
    "    2004: [\n",
    "        4092.27,\n",
    "        1319.76,\n",
    "        2805.47,\n",
    "        1375.67,\n",
    "        1270,\n",
    "        2811.95,\n",
    "        1223.64,\n",
    "        1657.77,\n",
    "        4097.26,\n",
    "        5198.03,\n",
    "        4584.22,\n",
    "        1963.9,\n",
    "        2206.02,\n",
    "        1225.8,\n",
    "        4764.7,\n",
    "        2722.4,\n",
    "        2292.55,\n",
    "        2428.95,\n",
    "        8335.3,\n",
    "        1361.92,\n",
    "        335.3,\n",
    "        1229.62,\n",
    "        2510.3,\n",
    "        661.8,\n",
    "        1192.53,\n",
    "        123.3,\n",
    "        1234.6,\n",
    "        688.41,\n",
    "        193.7,\n",
    "        227.73,\n",
    "        833.36,\n",
    "    ],\n",
    "    2003: [\n",
    "        3435.95,\n",
    "        1150.81,\n",
    "        2439.68,\n",
    "        1176.65,\n",
    "        1000.79,\n",
    "        2487.85,\n",
    "        1075.48,\n",
    "        1467.9,\n",
    "        3404.19,\n",
    "        4493.31,\n",
    "        3890.79,\n",
    "        1638.42,\n",
    "        1949.91,\n",
    "        1043.08,\n",
    "        4112.43,\n",
    "        2358.86,\n",
    "        2003.08,\n",
    "        1995.78,\n",
    "        7178.94,\n",
    "        1178.25,\n",
    "        293.85,\n",
    "        1081.35,\n",
    "        2189.68,\n",
    "        558.28,\n",
    "        1013.76,\n",
    "        96.76,\n",
    "        1063.89,\n",
    "        589.91,\n",
    "        169.81,\n",
    "        195.46,\n",
    "        753.91,\n",
    "    ],\n",
    "    2002: [\n",
    "        2982.57,\n",
    "        997.47,\n",
    "        2149.75,\n",
    "        992.69,\n",
    "        811.47,\n",
    "        2258.17,\n",
    "        958.88,\n",
    "        1319.4,\n",
    "        3038.9,\n",
    "        3891.92,\n",
    "        3227.99,\n",
    "        1399.02,\n",
    "        1765.8,\n",
    "        972.73,\n",
    "        3700.52,\n",
    "        1978.37,\n",
    "        1795.93,\n",
    "        1780.79,\n",
    "        6343.94,\n",
    "        1074.85,\n",
    "        270.96,\n",
    "        956.12,\n",
    "        1943.68,\n",
    "        480.37,\n",
    "        914.5,\n",
    "        89.56,\n",
    "        963.62,\n",
    "        514.83,\n",
    "        148.83,\n",
    "        171.14,\n",
    "        704.5,\n",
    "    ],\n",
    "}\n",
    "\n",
    "data_financial = {\n",
    "    2011: [\n",
    "        12363.18,\n",
    "        5219.24,\n",
    "        8483.17,\n",
    "        3960.87,\n",
    "        5015.89,\n",
    "        8158.98,\n",
    "        3679.91,\n",
    "        4918.09,\n",
    "        11142.86,\n",
    "        20842.21,\n",
    "        14180.23,\n",
    "        4975.96,\n",
    "        6878.74,\n",
    "        3921.2,\n",
    "        17370.89,\n",
    "        7991.72,\n",
    "        7247.02,\n",
    "        7539.54,\n",
    "        24097.7,\n",
    "        3998.33,\n",
    "        1148.93,\n",
    "        3623.81,\n",
    "        7014.04,\n",
    "        2781.29,\n",
    "        3701.79,\n",
    "        322.57,\n",
    "        4355.81,\n",
    "        1963.79,\n",
    "        540.18,\n",
    "        861.92,\n",
    "        2245.12,\n",
    "    ],\n",
    "    2010: [\n",
    "        10600.84,\n",
    "        4238.65,\n",
    "        7123.77,\n",
    "        3412.38,\n",
    "        4209.03,\n",
    "        6849.37,\n",
    "        3111.12,\n",
    "        4040.55,\n",
    "        9833.51,\n",
    "        17131.45,\n",
    "        12063.82,\n",
    "        4193.69,\n",
    "        5850.62,\n",
    "        3121.4,\n",
    "        14343.14,\n",
    "        6607.89,\n",
    "        6053.37,\n",
    "        6369.27,\n",
    "        20711.55,\n",
    "        3383.11,\n",
    "        953.67,\n",
    "        2881.08,\n",
    "        6030.41,\n",
    "        2177.07,\n",
    "        2892.31,\n",
    "        274.82,\n",
    "        3688.93,\n",
    "        1536.5,\n",
    "        470.88,\n",
    "        702.45,\n",
    "        1766.69,\n",
    "    ],\n",
    "    2009: [\n",
    "        9179.19,\n",
    "        3405.16,\n",
    "        6068.31,\n",
    "        2886.92,\n",
    "        3696.65,\n",
    "        5891.25,\n",
    "        2756.26,\n",
    "        3371.95,\n",
    "        8930.85,\n",
    "        13629.07,\n",
    "        9918.78,\n",
    "        3662.15,\n",
    "        5048.49,\n",
    "        2637.07,\n",
    "        11768.18,\n",
    "        5700.91,\n",
    "        5127.12,\n",
    "        5402.81,\n",
    "        18052.59,\n",
    "        2919.13,\n",
    "        748.59,\n",
    "        2474.44,\n",
    "        5198.8,\n",
    "        1885.79,\n",
    "        2519.62,\n",
    "        240.85,\n",
    "        3143.74,\n",
    "        1363.27,\n",
    "        398.54,\n",
    "        563.74,\n",
    "        1587.72,\n",
    "    ],\n",
    "    2008: [\n",
    "        8375.76,\n",
    "        2886.65,\n",
    "        5276.04,\n",
    "        2759.46,\n",
    "        3212.06,\n",
    "        5207.72,\n",
    "        2412.26,\n",
    "        2905.68,\n",
    "        7872.23,\n",
    "        11888.53,\n",
    "        8799.31,\n",
    "        3234.64,\n",
    "        4346.4,\n",
    "        2355.86,\n",
    "        10358.64,\n",
    "        5099.76,\n",
    "        4466.85,\n",
    "        4633.67,\n",
    "        16321.46,\n",
    "        2529.51,\n",
    "        643.47,\n",
    "        2160.48,\n",
    "        4561.69,\n",
    "        1652.34,\n",
    "        2218.81,\n",
    "        218.67,\n",
    "        2699.74,\n",
    "        1234.21,\n",
    "        355.93,\n",
    "        475,\n",
    "        1421.38,\n",
    "    ],\n",
    "    2007: [\n",
    "        7236.15,\n",
    "        2250.04,\n",
    "        4600.72,\n",
    "        2257.99,\n",
    "        2467.41,\n",
    "        4486.74,\n",
    "        2025.44,\n",
    "        2493.04,\n",
    "        6821.11,\n",
    "        9730.91,\n",
    "        7613.46,\n",
    "        2789.78,\n",
    "        3770,\n",
    "        1918.95,\n",
    "        8620.24,\n",
    "        4511.97,\n",
    "        3812.34,\n",
    "        3835.4,\n",
    "        14076.83,\n",
    "        2156.76,\n",
    "        528.84,\n",
    "        1825.21,\n",
    "        3881.6,\n",
    "        1312.94,\n",
    "        1896.78,\n",
    "        188.06,\n",
    "        2178.2,\n",
    "        1037.11,\n",
    "        294.91,\n",
    "        366.18,\n",
    "        1246.89,\n",
    "    ],\n",
    "    2006: [\n",
    "        5837.55,\n",
    "        1902.31,\n",
    "        3895.36,\n",
    "        1846.18,\n",
    "        1934.35,\n",
    "        3798.26,\n",
    "        1687.07,\n",
    "        2096.35,\n",
    "        5508.48,\n",
    "        7914.11,\n",
    "        6281.86,\n",
    "        2390.29,\n",
    "        3022.83,\n",
    "        1614.65,\n",
    "        7187.26,\n",
    "        3721.44,\n",
    "        3111.98,\n",
    "        3229.42,\n",
    "        11585.82,\n",
    "        1835.12,\n",
    "        433.57,\n",
    "        1649.2,\n",
    "        3319.62,\n",
    "        989.38,\n",
    "        1557.91,\n",
    "        159.76,\n",
    "        1806.36,\n",
    "        900.16,\n",
    "        249.04,\n",
    "        294.78,\n",
    "        1058.16,\n",
    "    ],\n",
    "    2005: [\n",
    "        4854.33,\n",
    "        1658.19,\n",
    "        3340.54,\n",
    "        1611.07,\n",
    "        1542.26,\n",
    "        3295.45,\n",
    "        1413.83,\n",
    "        1857.42,\n",
    "        4776.2,\n",
    "        6612.22,\n",
    "        5360.1,\n",
    "        2137.77,\n",
    "        2551.41,\n",
    "        1411.92,\n",
    "        5924.74,\n",
    "        3181.27,\n",
    "        2655.94,\n",
    "        2882.88,\n",
    "        9772.5,\n",
    "        1560.92,\n",
    "        377.17,\n",
    "        1440.32,\n",
    "        2836.73,\n",
    "        815.32,\n",
    "        1374.62,\n",
    "        137.24,\n",
    "        1546.59,\n",
    "        787.36,\n",
    "        213.37,\n",
    "        259.49,\n",
    "        929.41,\n",
    "    ],\n",
    "    2004: [\n",
    "        4092.27,\n",
    "        1319.76,\n",
    "        2805.47,\n",
    "        1375.67,\n",
    "        1270,\n",
    "        2811.95,\n",
    "        1223.64,\n",
    "        1657.77,\n",
    "        4097.26,\n",
    "        5198.03,\n",
    "        4584.22,\n",
    "        1963.9,\n",
    "        2206.02,\n",
    "        1225.8,\n",
    "        4764.7,\n",
    "        2722.4,\n",
    "        2292.55,\n",
    "        2428.95,\n",
    "        8335.3,\n",
    "        1361.92,\n",
    "        335.3,\n",
    "        1229.62,\n",
    "        2510.3,\n",
    "        661.8,\n",
    "        1192.53,\n",
    "        123.3,\n",
    "        1234.6,\n",
    "        688.41,\n",
    "        193.7,\n",
    "        227.73,\n",
    "        833.36,\n",
    "    ],\n",
    "    2003: [\n",
    "        3435.95,\n",
    "        1150.81,\n",
    "        2439.68,\n",
    "        1176.65,\n",
    "        1000.79,\n",
    "        2487.85,\n",
    "        1075.48,\n",
    "        1467.9,\n",
    "        3404.19,\n",
    "        4493.31,\n",
    "        3890.79,\n",
    "        1638.42,\n",
    "        1949.91,\n",
    "        1043.08,\n",
    "        4112.43,\n",
    "        2358.86,\n",
    "        2003.08,\n",
    "        1995.78,\n",
    "        7178.94,\n",
    "        1178.25,\n",
    "        293.85,\n",
    "        1081.35,\n",
    "        2189.68,\n",
    "        558.28,\n",
    "        1013.76,\n",
    "        96.76,\n",
    "        1063.89,\n",
    "        589.91,\n",
    "        169.81,\n",
    "        195.46,\n",
    "        753.91,\n",
    "    ],\n",
    "    2002: [\n",
    "        2982.57,\n",
    "        997.47,\n",
    "        2149.75,\n",
    "        992.69,\n",
    "        811.47,\n",
    "        2258.17,\n",
    "        958.88,\n",
    "        1319.4,\n",
    "        3038.9,\n",
    "        3891.92,\n",
    "        3227.99,\n",
    "        1399.02,\n",
    "        1765.8,\n",
    "        972.73,\n",
    "        3700.52,\n",
    "        1978.37,\n",
    "        1795.93,\n",
    "        1780.79,\n",
    "        6343.94,\n",
    "        1074.85,\n",
    "        270.96,\n",
    "        956.12,\n",
    "        1943.68,\n",
    "        480.37,\n",
    "        914.5,\n",
    "        89.56,\n",
    "        963.62,\n",
    "        514.83,\n",
    "        148.83,\n",
    "        171.14,\n",
    "        704.5,\n",
    "    ],\n",
    "}\n",
    "\n",
    "\n",
    "def format_data(data: dict) -> dict:\n",
    "    for year in range(2002, 2012):\n",
    "        max_data, sum_data = 0, 0\n",
    "        temp = data[year]\n",
    "        max_data = max(temp)\n",
    "        for i in range(len(temp)):\n",
    "            sum_data += temp[i]\n",
    "            data[year][i] = {\"name\": name_list[i], \"value\": temp[i]}\n",
    "        data[str(year) + \"max\"] = int(max_data / 100) * 100\n",
    "        data[str(year) + \"sum\"] = sum_data\n",
    "    return data\n",
    "\n",
    "\n",
    "# GDP\n",
    "total_data[\"dataGDP\"] = format_data(data=data_gdp)\n",
    "# 第一产业\n",
    "total_data[\"dataPI\"] = format_data(data=data_pi)\n",
    "# 第二产业\n",
    "total_data[\"dataSI\"] = format_data(data=data_si)\n",
    "# 第三产业\n",
    "total_data[\"dataTI\"] = format_data(data=data_ti)\n",
    "# 房地产\n",
    "total_data[\"dataEstate\"] = format_data(data=data_estate)\n",
    "# 金融\n",
    "total_data[\"dataFinancial\"] = format_data(data=data_financial)\n",
    "\n",
    "\n",
    "#####################################################################################\n",
    "# 2002 - 2011 年的数据\n",
    "def get_year_overlap_chart(year: int) -> Bar:\n",
    "    bar = (\n",
    "        Bar()\n",
    "        .add_xaxis(xaxis_data=name_list)\n",
    "        .add_yaxis(\n",
    "            series_name=\"GDP\",\n",
    "            yaxis_data=total_data[\"dataGDP\"][year],\n",
    "            is_selected=False,\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        )\n",
    "        .add_yaxis(\n",
    "            series_name=\"金融\",\n",
    "            yaxis_data=total_data[\"dataFinancial\"][year],\n",
    "            is_selected=False,\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        )\n",
    "        .add_yaxis(\n",
    "            series_name=\"房地产\",\n",
    "            yaxis_data=total_data[\"dataEstate\"][year],\n",
    "            is_selected=False,\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        )\n",
    "        .add_yaxis(\n",
    "            series_name=\"第一产业\",\n",
    "            yaxis_data=total_data[\"dataPI\"][year],\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        )\n",
    "        .add_yaxis(\n",
    "            series_name=\"第二产业\",\n",
    "            yaxis_data=total_data[\"dataSI\"][year],\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        )\n",
    "        .add_yaxis(\n",
    "            series_name=\"第三产业\",\n",
    "            yaxis_data=total_data[\"dataTI\"][year],\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        )\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(\n",
    "                title=\"{}全国宏观经济指标\".format(year), subtitle=\"数据来自国家统计局\"\n",
    "            ),\n",
    "            tooltip_opts=opts.TooltipOpts(\n",
    "                is_show=True, trigger=\"axis\", axis_pointer_type=\"shadow\"\n",
    "            ),\n",
    "        )\n",
    "    )\n",
    "    pie = (\n",
    "        Pie()\n",
    "        .add(\n",
    "            series_name=\"GDP占比\",\n",
    "            data_pair=[\n",
    "                [\"第一产业\", total_data[\"dataPI\"][\"{}sum\".format(year)]],\n",
    "                [\"第二产业\", total_data[\"dataSI\"][\"{}sum\".format(year)]],\n",
    "                [\"第三产业\", total_data[\"dataTI\"][\"{}sum\".format(year)]],\n",
    "            ],\n",
    "            center=[\"75%\", \"35%\"],\n",
    "            radius=\"28%\",\n",
    "        )\n",
    "        .set_series_opts(tooltip_opts=opts.TooltipOpts(is_show=True, trigger=\"item\"))\n",
    "    )\n",
    "    return bar.overlap(pie)\n",
    "\n",
    "\n",
    "# 生成时间轴的图\n",
    "timeline = Timeline(init_opts=opts.InitOpts(width=\"1600px\", height=\"800px\"))\n",
    "\n",
    "for y in range(2002, 2012):\n",
    "    timeline.add(get_year_overlap_chart(year=y), time_point=str(y))\n",
    "\n",
    "# 1.0.0 版本的 add_schema 暂时没有补上 return self 所以只能这么写着\n",
    "timeline.add_schema(is_auto_play=True, play_interval=1000)\n",
    "timeline.render(\"finance_indices_2002.html\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "54d59fa9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
